<?php
/**
 * Json compat package
 */

if (!function_exists('json_encode')) {
    $json_dir = INCLUDE_ROOT. 'json'. DIRECTORY_SEPARATOR;

    require $json_dir. 'Exception.php';
    require $json_dir. 'Encoder.php';
    require $json_dir. 'Decoder.php';

    class Zend_Json {
        const TYPE_ARRAY = TRUE;
        const TYPE_OBJECT = FALSE;
    }

    function json_encode($value, $cycleCheck = false) {
        return Zend_Json_Encoder::encode($value, $cycleCheck);
    }

    function json_decode($source = NULL, $objectDecodeType = Zend_Json::TYPE_OBJECT) {
        return Zend_Json_Decoder::decode($source, $objectDecodeType);
    }
}
?>